<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * $Id: om-grid.js,v 1.164 2012/06/29 09:20:32 chentianzhen Exp $
<span class='line'>  3</span>  * operamasks-ui omGrid @VERSION
<span class='line'>  4</span>  *
<span class='line'>  5</span>  * Copyright 2011, AUTHORS.txt (http://ui.operamasks.org/about)
<span class='line'>  6</span>  * Dual licensed under the MIT or LGPL Version 2 licenses.
<span class='line'>  7</span>  * http://ui.operamasks.org/license
<span class='line'>  8</span>  *
<span class='line'>  9</span>  * http://ui.operamasks.org/docs/
<span class='line'> 10</span>  * 
<span class='line'> 11</span>  * Depends:
<span class='line'> 12</span>  *  om-core.js
<span class='line'> 13</span>  *  om-mouse.js
<span class='line'> 14</span>  *  om-resizable.js
<span class='line'> 15</span>  */</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> 
<span class='line'> 17</span> </span><span class="COMM">/**
<span class='line'> 18</span>      * @name omGrid
<span class='line'> 19</span>      * @class 表格组件。类似于html中的table，支持后台数据源、分页、自动列宽、单选/多选、行样式、自定义列渲染等功能。&lt;br/>&lt;br/>
<span class='line'> 20</span>      * &lt;b>特点：&lt;/b>&lt;br/>
<span class='line'> 21</span>      * &lt;ol>
<span class='line'> 22</span>      *      &lt;li>使用远程数据源&lt;/li>
<span class='line'> 23</span>      *      &lt;li>支持分页展现&lt;/li>
<span class='line'> 24</span>      *      &lt;li>自动添加行号&lt;/li>
<span class='line'> 25</span>      *      &lt;li>允许某列的宽度自动扩充（该列宽度等于表格总宽度送去其它列宽度之和）&lt;/li>
<span class='line'> 26</span>      *      &lt;li>允许所有列自动缩放（自动缩放各列的宽度，使得它适应表格的总宽度）&lt;/li>
<span class='line'> 27</span>      *      &lt;li>可以定制隔行样式，也可以根据记录的不同使用不同的行样式&lt;/li>
<span class='line'> 28</span>      *      &lt;li>可以定制各列的显示效果&lt;/li>
<span class='line'> 29</span>      *      &lt;li>可以设置表头和表体自动换行&lt;/li>
<span class='line'> 30</span>      *      &lt;li>可以改变列宽&lt;/li>
<span class='line'> 31</span>      *      &lt;li>提供丰富的事件&lt;/li>
<span class='line'> 32</span>      * &lt;/ol>
<span class='line'> 33</span>      * 
<span class='line'> 34</span>      * &lt;b>示例：&lt;/b>&lt;br/>
<span class='line'> 35</span>      * &lt;pre>
<span class='line'> 36</span>      * &lt;script type="text/javascript" >
<span class='line'> 37</span>      *  $(document).ready(function() {
<span class='line'> 38</span>      *      $('#mytable').omGrid({
<span class='line'> 39</span>      *          height : 250,
<span class='line'> 40</span>      *          width : 600,
<span class='line'> 41</span>      *          limit : 8, //分页显示，每页显示8条
<span class='line'> 42</span>      *          singleSelect : false, //出现checkbox列，可以选择同时多行记录
<span class='line'> 43</span>      *          colModel : [    {header:'编号',name:'id', width:100, align : 'center'},
<span class='line'> 44</span>      *                          {header:'地区',name:'city', width:250, align : 'left',wrap:true},
<span class='line'> 45</span>      *                          {header:'地址',name:'address', width:'autoExpand',renderer:function(value,rowData,rowIndex){ return '&lt;b>'+value+'&lt/b>'; }}
<span class='line'> 46</span>      *          ],
<span class='line'> 47</span>      *          dataSource : 'griddata.json' //后台取数的URL
<span class='line'> 48</span>      *      });
<span class='line'> 49</span>      *  });
<span class='line'> 50</span>      * &lt;/script>
<span class='line'> 51</span>      * 
<span class='line'> 52</span>      * &lt;table id="mytable"/>
<span class='line'> 53</span>      * &lt;/pre>
<span class='line'> 54</span>      * 
<span class='line'> 55</span>      * 后台返回的数据格式如下（可以不包含空格换行等格式内容，大括号内的各属性顺序可任意交换）：&lt;br/>
<span class='line'> 56</span>      * &lt;pre>
<span class='line'> 57</span>      * {"total":126, "rows":
<span class='line'> 58</span>      *     [
<span class='line'> 59</span>      *         {"address":"CZ88.NET ","city":"IANA保留地址","id":"1"},
<span class='line'> 60</span>      *         {"address":"CZ88.NET ","city":"澳大利亚","id":"2"},
<span class='line'> 61</span>      *         {"address":"电信","city":"福建省","id":"3"},
<span class='line'> 62</span>      *         {"address":"CZ88.NET ","city":"澳大利亚","id":"4"},
<span class='line'> 63</span>      *         {"address":"CZ88.NET ","city":"泰国","id":"5"},
<span class='line'> 64</span>      *         {"address":"CZ88.NET ","city":"日本","id":"6"},
<span class='line'> 65</span>      *         {"address":"电信","city":"广东省","id":"7"},
<span class='line'> 66</span>      *         {"address":"CZ88.NET ","city":"日本","id":"8"}
<span class='line'> 67</span>      *     ]
<span class='line'> 68</span>      * }
<span class='line'> 69</span>      * &lt;/pre>
<span class='line'> 70</span>      * 
<span class='line'> 71</span>      * &lt;b>其它特殊说明：&lt;/b>&lt;br/>
<span class='line'> 72</span>      * 单击一行时有可能会触发onRowSelect、onRowDeselect、onRowClick这些事件中一个一个或多个。具体结果是这样的：
<span class='line'> 73</span>      * &lt;ol>
<span class='line'> 74</span>      *     &lt;li>单选（一次只能选择一行）表格：①如果该行还未被选中，先触发其它已选择的行的onRowDeselect事件监听再触发该行的onRowSelect事件监听②触发该行的onRowClick事件监听。&lt;/li>
<span class='line'> 75</span>      *     &lt;li>多选（一次可以选择多行）表格：①如果该行还未被选中，先触发该行的onRowSelect事件监听，如果该行已经选中，则先触发该行的onRowDeselect事件监听②触发该行的onRowClick事件监听。&lt;/li>
<span class='line'> 76</span>      * &lt;/ol>
<span class='line'> 77</span>      * 
<span class='line'> 78</span>      * 请求参数说明
<span class='line'> 79</span>      * &lt;ol>
<span class='line'> 80</span>      * 		&lt;li>组件在请求数据时会加上start和limit两个参数。比如请求第一页数据时url会自动添加上 start=0&limit=20。 &lt;/li>
<span class='line'> 81</span>      * &lt;/ol>
<span class='line'> 82</span>      * @constructor
<span class='line'> 83</span>      * @description 构造函数. 
<span class='line'> 84</span>      * @param p 标准config对象：{}
<span class='line'> 85</span>      */</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="PUNC">;</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">    </span><span class="NAME">$.omWidget</span><span class="PUNC">(</span><span class="STRN">'om.omGrid'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">        </span><span class="NAME">options</span><span class="PUNC">:</span><span class="COMM">/** @lends omGrid#*/</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">            </span><span class="COMM">//外观</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'> 91</span>              * 表格高度，设为数字时单位为px,也可以设为'fit'，表示自适应父容器高度。
<span class='line'> 92</span>              * @default 462
<span class='line'> 93</span>              * @type Number
<span class='line'> 94</span>              * @example
<span class='line'> 95</span>              * $('.selector').omGrid({height : 300});
<span class='line'> 96</span>              */</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">            </span><span class="NAME">height</span><span class="PUNC">:</span><span class="NUMB">462</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'> 99</span>              * 表格宽度，设为数字时单位为px,也可以设为'fit'，表示自适应父容器宽度。
<span class='line'>100</span>              * @type Number,String
<span class='line'>101</span>              * @default '100%'
<span class='line'>102</span>              * @example
<span class='line'>103</span>              * $('.selector').omGrid({width : 600});
<span class='line'>104</span>              */</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">            </span><span class="NAME">width</span><span class="PUNC">:</span><span class="STRN">'100%'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>107</span>              * 列数据模型。每一个元素都是一个对象字面量，定义该列的各个属性，这些属性包括:&lt;br/>
<span class='line'>108</span>              * header : 表头文字。&lt;br/>
<span class='line'>109</span>              * name : 与数据模型对应的字段。&lt;br/>
<span class='line'>110</span>              * align : 列文字对齐方式，可以为'left'、'center'、'right'之中的一个。&lt;br/>
<span class='line'>111</span>              * renderer : 列的渲染函数，接受3个参数，v表示当前值，rowData表示当前行数据，rowIndex表示当前行号(从0开始)，&lt;br/>
<span class='line'>112</span>              * width : 列的宽度，取值为Number或者'autoExpand'。注意只能有一个列被设置为'autoExpand'属性。&lt;br/>
<span class='line'>113</span>              * wrap : 是否自动换行，取值为true或者false。&lt;br/>
<span class='line'>114</span>              * @type Array[JSON]
<span class='line'>115</span>              * @default false
<span class='line'>116</span>              * @example
<span class='line'>117</span>              * 
<span class='line'>118</span>              * $(".selector").omGrid({
<span class='line'>119</span>              *      colModel : [ {
<span class='line'>120</span>              *              header : '地区',          //表头文字
<span class='line'>121</span>              *              name : 'city',          //与数据模型对应的字段
<span class='line'>122</span>              *              width : 120,            //列宽,可设置具体数字，也可设置为'autoExpand'，表示自动扩展
<span class='line'>123</span>              *              align : 'left',         //列文字对齐
<span class='line'>124</span>              *              renderer : function(v, rowData , rowIndex) {   //列渲染函数，接受3个参数，v表示当前值，rowData表示当前行数据，rowIndex表示当前行号(从0开始)
<span class='line'>125</span>              *                  return '&lt;b>'+v+'&lt;/b>';  //地区这一列的文字加粗显示
<span class='line'>126</span>              *              }
<span class='line'>127</span>              *          }, {
<span class='line'>128</span>              *              header : '地址',
<span class='line'>129</span>              *              name : 'address',
<span class='line'>130</span>              *              align : 'left',
<span class='line'>131</span>              *              width : 'autoExpand'
<span class='line'>132</span>              *          } 
<span class='line'>133</span>              *      ]
<span class='line'>134</span>              * });
<span class='line'>135</span>              */</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">            </span><span class="NAME">colModel</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>138</span>              * 是否自动拉伸各列以适应表格的宽度（比如共2列第一列宽度100第二列宽度200，则当表格总宽度是600px时第一列自动会变成200px第二列宽度会自动变成400px，而如果表格总宽度是210px时第一列自动会变成70px第二列宽度会自动变成140px）。&lt;b>注意：只有所有列的宽度都不是'autoExpand'时该属性才会起作用。&lt;/b>
<span class='line'>139</span>              * @default false
<span class='line'>140</span>              * @type Boolean
<span class='line'>141</span>              * @example
<span class='line'>142</span>              * $('.selector').omGrid({autoFit : true});
<span class='line'>143</span>              */</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">            </span><span class="NAME">autoFit</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>146</span>              * 是否在最左边显示序号列。
<span class='line'>147</span>              * @default true
<span class='line'>148</span>              * @type Boolean
<span class='line'>149</span>              * @example
<span class='line'>150</span>              * $('.selector').omGrid({showIndex : false});
<span class='line'>151</span>              */</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">            </span><span class="NAME">showIndex</span><span class="PUNC">:</span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">            </span><span class="COMM">//数据源</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>155</span>              * ajax取数方式对应的url地址。
<span class='line'>156</span>              * @type String
<span class='line'>157</span>              * @default 无
<span class='line'>158</span>              * @example
<span class='line'>159</span>              * //下面的示例设置的url，表示将从griddata.json这个地址取数，同时附带有start和limit两个请求参数。
<span class='line'>160</span>              * //该文件必须返回一段具有特定格式（格式可参考文档的“预览”页签的说明）的JSON数据，omGrid拿到该数据即可用来填充表格。
<span class='line'>161</span>              * $('.selector').omGrid({url:'griddata.json'});
<span class='line'>162</span>              */</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">            </span><span class="NAME">dataSource</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">             </span><span class="COMM">/**
<span class='line'>165</span>              * ajax取数时附加到请求的额外参数。&lt;b>注意：这里JSON的value值只能使用普通值，比如可以设置为{key1:1,key2:'2',key3:0.2,key4:true,key5:undefined}这样，但是不可以设置为{key1:[]}或{key2:{a:1,b:2}}，因为[]和{a:1,b:2}都不是普通值&lt;/b>
<span class='line'>166</span>              * @type JSON
<span class='line'>167</span>              * @default {}
<span class='line'>168</span>              * @example
<span class='line'>169</span>              * //下面的示例在Ajax取数时将从griddata.json这个地址取数，同时附带有start、limit、googType、localtion这4个请求参数。
<span class='line'>170</span>              * //真正的URL地址可能是griddata.json?start=0&limit=10&goodType=1&location=beijing
<span class='line'>171</span>              * $('.selector').omGrid({url:'griddata.json',extraData:{googType:1,localtion:'beijing'} });
<span class='line'>172</span>              */</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">            </span><span class="NAME">extraData</span><span class="PUNC">:</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>175</span>              * 使用GET请求还是POST请求来取数据，取值为：'POST'或'GET'。
<span class='line'>176</span>              * @type String
<span class='line'>177</span>              * @default 'GET'
<span class='line'>178</span>              * @example
<span class='line'>179</span>              * $('.selector').omGrid({method : 'POST'});
<span class='line'>180</span>              */</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">            </span><span class="NAME">method</span><span class="PUNC">:</span><span class="STRN">'GET'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>183</span>              * 正在取数时显示在分页条上的提示。
<span class='line'>184</span>              * @name omGrid#loadingMsg
<span class='line'>185</span>              * @type String
<span class='line'>186</span>              * @default '正在加载数据，请稍候...'
<span class='line'>187</span>              * @example
<span class='line'>188</span>              * $('.selector').omGrid({loadingMsg : '取数中...'});
<span class='line'>189</span>              */</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">            </span><span class="COMM">//loadingMsg:$.om.lang.omGrid.loadingMsg,</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>192</span>              * 取数完成后但是后台没有返回任何数据时显示在分页条上的提示。
<span class='line'>193</span>              * @name omGrid#emptyMsg
<span class='line'>194</span>              * @type String
<span class='line'>195</span>              * @default '没有数据'
<span class='line'>196</span>              * @example
<span class='line'>197</span>              * $('.selector').omGrid({emptyMsg : 'No data!'});
<span class='line'>198</span>              */</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">            </span><span class="COMM">//emptyMsg:$.om.lang.omGrid.emptyMsg,</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>201</span>              * 取数发生错误时显示在分页条上的提示。
<span class='line'>202</span>              * @name omGrid#errorMsg
<span class='line'>203</span>              * @type String
<span class='line'>204</span>              * @default '取数出错'
<span class='line'>205</span>              * @example
<span class='line'>206</span>              * $('.selector').omGrid({emptyMsg : '应用异常，请与网站管理员联系!'});
<span class='line'>207</span>              */</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">            </span><span class="COMM">//errorMsg:$.om.lang.omGrid.errorMsg,</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>210</span>              * 取数成功后的预处理，可以在取数成功后开始显示数据前对后台返回的数据进行一次预处理。&lt;b>注意：此方法一定要返回一个值&lt;/b>。
<span class='line'>211</span>              * @type Function
<span class='line'>212</span>              * @default 无
<span class='line'>213</span>              * @example
<span class='line'>214</span>              * //将后台返回的数据中所有记录的id属性改名成name属性，并将sex中的0/1分别转换为'男'或'女'。
<span class='line'>215</span>              * //如后台返回{"total":35,"rows":[{id:1,sex:0,password:'abc'},{id:2,sex:1,password:'def'}]}
<span class='line'>216</span>              * //转换后结果为{"total":35,"rows":[{name:1,sex:'男',password:'abc'},{name:2,sex:'女',password:'def'}]}
<span class='line'>217</span>              * $('.selector').omGrid({preProcess : function(data){
<span class='line'>218</span>              *          var temp;
<span class='line'>219</span>              *          for(var i=0,len=data.rows.length;i&lt;len;i++){
<span class='line'>220</span>              *              temp=data.rows[i];
<span class='line'>221</span>              *              temp.name=temp.id;
<span class='line'>222</span>              *              temp.id=undefined;
<span class='line'>223</span>              *              temp.sex= temp.sex==0?'男':'女';
<span class='line'>224</span>              *          }
<span class='line'>225</span>              *          return data;
<span class='line'>226</span>              *      }
<span class='line'>227</span>              * });
<span class='line'>228</span>              */</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">            </span><span class="NAME">preProcess</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">            </span><span class="COMM">//分页</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>232</span>              * 每页数据条数，比如每页要显示10条则设成10。&lt;b>注意：如果设成0或负数则不分页&lt;/b>。此属性仅用于取数不用于显示（即如果limit设成10，取数时告诉后台要10条数据，如果后台非要返回15条数据，则页面会显示出15条而不是10条数据）。
<span class='line'>233</span>              * @type Number
<span class='line'>234</span>              * @default 15
<span class='line'>235</span>              * @example
<span class='line'>236</span>              * $('.selector').omGrid({limit : 15});
<span class='line'>237</span>              */</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">            </span><span class="NAME">limit</span><span class="PUNC">:</span><span class="NUMB">15</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>240</span>              * 显示在分页条上“上一页”和“下一页”按钮之间的文字。在显示时其中的{totalPage}会被替换为总页数，{index}会被替换为一个输入框（默认显示当前的页号，用户可以输入任意数字然后回车来跳转到指定的页）。
<span class='line'>241</span>              * @name omGrid#pageText
<span class='line'>242</span>              * @type String
<span class='line'>243</span>              * @default '第{index}页，共{totalPage}页'
<span class='line'>244</span>              * @example
<span class='line'>245</span>              * $('.selector').omGrid({pageText : '共{totalPage}页，转到{index}页'});
<span class='line'>246</span>              */</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">            </span><span class="COMM">//pageText:$.om.lang.omGrid.pageText,</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>249</span>              * 显示在分页条上的统计文字。在显示时其中的{total}会被替换为总记录数，{from}和{to}会被替换为当前显示的起止行号。比如可能会显示成'共125条数据，显示21-30条'。
<span class='line'>250</span>              * @name omGrid#pageStat
<span class='line'>251</span>              * @type String
<span class='line'>252</span>              * @default '共{total}条数据，显示{from}-{to}条'
<span class='line'>253</span>              * @example
<span class='line'>254</span>              * $('.selector').omGrid({pageStat : '总共有{total}条记录，当前正在显示第{from}行至第{to}行'});
<span class='line'>255</span>              */</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">            </span><span class="COMM">//pageStat:$.om.lang.omGrid.pageStat,</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">            </span><span class="COMM">//行显示</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>259</span>              * 行样式，默认显示成斑马纹（奇偶行背景不一样）。当然用户也可以定义成3行一循环或5行一循环。也可以定义成一个Function来根据行数据不同显示成不同的样式（比如一个显示学生成绩的表格中把不及格的记录整行显示成红色背景，满分的记录整行显示成绿色背景）。
<span class='line'>260</span>              * @type Array或Function
<span class='line'>261</span>              * @default ['oddRow','evenRow']
<span class='line'>262</span>              * @example
<span class='line'>263</span>              * 
<span class='line'>264</span>              * //示例1：结果表格中第1/4/7/10...行的tr会加上样式class1；
<span class='line'>265</span>              * //第2/5/8/11...行的tr会加上样式class2；
<span class='line'>266</span>              * //第3/6/9/12...行的tr会加上样式class3
<span class='line'>267</span>              * $('.selector').omGrid({rowClasses : ['class1','class2','class2']});
<span class='line'>268</span>              * 
<span class='line'>269</span>              * //示例2：满分的行加上样式fullMarks，不及格的行加上样式flunk，其它行使用默认样式。
<span class='line'>270</span>              * $('.selector').omGrid({rowClasses : function(rowIndex,rowData){
<span class='line'>271</span>              *          if(rowData.score==100){
<span class='line'>272</span>              *              reuturn 'fullMarks';
<span class='line'>273</span>              *          }else if(rowData.score&lt;60){
<span class='line'>274</span>              *              return 'flunk';
<span class='line'>275</span>              *          }
<span class='line'>276</span>              *      }
<span class='line'>277</span>              * });
<span class='line'>278</span>              */</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">            </span><span class="NAME">rowClasses</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="STRN">'oddRow'</span><span class="PUNC">,</span><span class="STRN">'evenRow'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">            </span><span class="COMM">//行选择</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>282</span>              * 是否只能单选（一次只能选择一条记录，选择第二条时第一条会自动取消选择）。若设置为false表示可以多选（选择其它行时原来已经选择的将继续保持选择状态）。&lt;b>注意：设成true时将不会出现checkbox列，设成false则将自动出现checkbox列&lt;/b>。
<span class='line'>283</span>              * @type Boolean
<span class='line'>284</span>              * @default true
<span class='line'>285</span>              * @example
<span class='line'>286</span>              * $('.selector').omGrid({singleSelect : false});
<span class='line'>287</span>              */</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">            </span><span class="NAME">singleSelect</span><span class="PUNC">:</span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">            
<span class='line'>290</span>             </span><span class="COMM">/**
<span class='line'>291</span>              * 设置组件的标题
<span class='line'>292</span>              * @type String
<span class='line'>293</span>              * @default ''
<span class='line'>294</span>              * @example
<span class='line'>295</span>              * $('.selector').omGrid({title : 'Data Grid'});
<span class='line'>296</span>              */</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">            </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">            
<span class='line'>299</span>             </span><span class="COMM">//event</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>301</span>              * 选择一行记录后执行的方法。
<span class='line'>302</span>              * @event
<span class='line'>303</span>              * @type Function
<span class='line'>304</span>              * @param rowIndex 行号（从0开始）
<span class='line'>305</span>              * @param rowData 选择的行所代表的JSON对象
<span class='line'>306</span>              * @param event jQuery.Event对象。
<span class='line'>307</span>              * @default 无
<span class='line'>308</span>              * @example
<span class='line'>309</span>              *  $(".selector").omGrid({
<span class='line'>310</span>              *      onRowSelect:function(rowIndex,rowData,event){
<span class='line'>311</span>              *          alert('the '+rowIndex+'th row has been selected!');
<span class='line'>312</span>              *      }
<span class='line'>313</span>              *  });
<span class='line'>314</span>              */</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">            </span><span class="NAME">onRowSelect</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>317</span>              * 取消一行记录的选择后执行的方法。
<span class='line'>318</span>              * @event
<span class='line'>319</span>              * @type Function
<span class='line'>320</span>              * @param rowIndex 行号（从0开始）
<span class='line'>321</span>              * @param rowData 选择的行所代表的JSON对象
<span class='line'>322</span>              * @param event jQuery.Event对象
<span class='line'>323</span>              * @default 无
<span class='line'>324</span>              * @example
<span class='line'>325</span>              *  $(".selector").omGrid({
<span class='line'>326</span>              *      onRowDeselect:function(rowIndex,rowData,event){
<span class='line'>327</span>              *          alert('the '+rowIndex+'th row has been deselected!');
<span class='line'>328</span>              *      }
<span class='line'>329</span>              *  });
<span class='line'>330</span>              */</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT">            </span><span class="NAME">onRowDeselect</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>333</span>              * 单击一行记录后执行的方法。
<span class='line'>334</span>              * @event
<span class='line'>335</span>              * @type Function
<span class='line'>336</span>              * @param rowIndex 行号（从0开始）
<span class='line'>337</span>              * @param rowData 选择的行所代表的JSON对象
<span class='line'>338</span>              * @param event jQuery.Event对象
<span class='line'>339</span>              * @default 无
<span class='line'>340</span>              * @example
<span class='line'>341</span>              *  $(".selector").omGrid({
<span class='line'>342</span>              *      onRowClick:function(rowIndex,rowData,event){
<span class='line'>343</span>              *          alert('the '+rowIndex+'th row has been clicked!city='+rowData.city);
<span class='line'>344</span>              *      }
<span class='line'>345</span>              *  });
<span class='line'>346</span>              */</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">            </span><span class="NAME">onRowClick</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>349</span>              * 双击一行记录后执行的方法。
<span class='line'>350</span>              * @event
<span class='line'>351</span>              * @type Function
<span class='line'>352</span>              * @param rowIndex 行号（从0开始）
<span class='line'>353</span>              * @param rowData 选择的行所代表的JSON对象
<span class='line'>354</span>              * @param event jQuery.Event对象
<span class='line'>355</span>              * @default 无
<span class='line'>356</span>              * @example
<span class='line'>357</span>              *  $(".selector").omGrid({
<span class='line'>358</span>              *      onRowDblClick:function(rowIndex,rowData,event){
<span class='line'>359</span>              *          alert('the '+rowIndex+'th row has been double clicked!city='+rowData.city);
<span class='line'>360</span>              *      }
<span class='line'>361</span>              *  });
<span class='line'>362</span>              */</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT">            </span><span class="NAME">onRowDblClick</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>365</span>              * 改变分页&lt;b>之前&lt;/b>执行的方法。&lt;b>注意：如果此方法返回false则不进行分页切换或跳转&lt;/b>。
<span class='line'>366</span>              * @event
<span class='line'>367</span>              * @type Function
<span class='line'>368</span>              * @param type 切换类型，是'first'、'prev'、'next'、'last'、'input'之一。
<span class='line'>369</span>              * @param newPage 要转到的页号（从1开始，第一页是1而不是0）
<span class='line'>370</span>              * @param event jQuery.Event对象
<span class='line'>371</span>              * @default 无
<span class='line'>372</span>              * @example
<span class='line'>373</span>              *  $(".selector").omGrid({
<span class='line'>374</span>              *      onPageChange:function(type,newPage,event){
<span class='line'>375</span>              *          alert('will goto page '+newPage);
<span class='line'>376</span>              *      }
<span class='line'>377</span>              *  });
<span class='line'>378</span>              */</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT">            </span><span class="NAME">onPageChange</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">,</span><span class="NAME">newPage</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>381</span>              * 从后台取数成功时执行的方法。
<span class='line'>382</span>              * @event
<span class='line'>383</span>              * @type Function
<span class='line'>384</span>              * @param data 取回来的数据（ 格式是{"total":35,"rows":[{"id":11,"city":"河南省安阳市","address":"电信"},{"id":12,"city":"北京市","address":"北龙中网科技有限公司"},{"id":13,"city":"澳大利亚","address":"CZ88.NET"}]}  ）。
<span class='line'>385</span>              * @param testStatus 响应的状态（参考jQuery的$.ajax的success属性）
<span class='line'>386</span>              * @param XMLHttpRequest XMLHttpRequest对象（参考jQuery的$.ajax的success属性）
<span class='line'>387</span>              * @param event jQuery.Event对象
<span class='line'>388</span>              * @default 无
<span class='line'>389</span>              * @example
<span class='line'>390</span>              *  $(".selector").omGrid({
<span class='line'>391</span>              *      onSuccess:function(data,testStatus,XMLHttpRequest,event){
<span class='line'>392</span>              *          alert('fetch data success,got '+data.rows+' rows');
<span class='line'>393</span>              *      }
<span class='line'>394</span>              *  });
<span class='line'>395</span>              */</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">            </span><span class="NAME">onSuccess</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">testStatus</span><span class="PUNC">,</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>398</span>              * 从后台取数失败时执行的方法。
<span class='line'>399</span>              * @event
<span class='line'>400</span>              * @type Function
<span class='line'>401</span>              * @param XMLHttpRequest XMLHttpRequest对象（参考jQuery的$.ajax的error属性）
<span class='line'>402</span>              * @param testStatus 响应的状态（参考jQuery的$.ajax的error属性）
<span class='line'>403</span>              * @param errorThrown 捕获的异常对象（参考jQuery的$.ajax的error属性）
<span class='line'>404</span>              * @param event jQuery.Event对象
<span class='line'>405</span>              * @default 无
<span class='line'>406</span>              * @example
<span class='line'>407</span>              *  $(".selector").omGrid({
<span class='line'>408</span>              *      onError:function(XMLHttpRequest,textStatus,errorThrown,event){
<span class='line'>409</span>              *          alert('fetch data error');
<span class='line'>410</span>              *      }
<span class='line'>411</span>              *  });
<span class='line'>412</span>              */</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT">            </span><span class="NAME">onError</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="NAME">errorThrown</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>415</span>              * 数据已全部显示到表体中后执行的方法。
<span class='line'>416</span>              * @event
<span class='line'>417</span>              * @type Function
<span class='line'>418</span>              * @param nowPage 当前页号(第一页是1第二页是2)
<span class='line'>419</span>              * @param pageRecords 当前页的所有记录
<span class='line'>420</span>              * @param event jQuery.Event对象
<span class='line'>421</span>              * @default 无
<span class='line'>422</span>              * @example
<span class='line'>423</span>              * //数据显示完后自动选中所有地址是'电信'的行。
<span class='line'>424</span>              *  $(".selector").omGrid({
<span class='line'>425</span>              *      signleSelect:false,
<span class='line'>426</span>              *      onRefresh:function(nowPage,pageRecords,event){
<span class='line'>427</span>              *          var rows=[];
<span class='line'>428</span>              *          $(pageRecords).each(function(i){
<span class='line'>429</span>              *              if(this.address=='电信'){
<span class='line'>430</span>              *                  rows.push(i);
<span class='line'>431</span>              *              }
<span class='line'>432</span>              *          });
<span class='line'>433</span>              *          $('.selector').omGrid('setSelections',rows);
<span class='line'>434</span>              *      }
<span class='line'>435</span>              *  });
<span class='line'>436</span>              */</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">            </span><span class="NAME">onRefresh</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">nowPage</span><span class="PUNC">,</span><span class="NAME">pageRecords</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>439</span>              *当重新刷新时的回调方法列表(仅内部使用)
<span class='line'>440</span>             */</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">            </span><span class="NAME">_onRefreshCallbacks</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">            
<span class='line'>443</span>             </span><span class="COMM">/**
<span class='line'>444</span>              * 当标题列改变大小后的回调事件列表，主要用于行编辑插件。(仅内部使用)
<span class='line'>445</span>              */</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">            </span><span class="NAME">_onResizableStopCallbacks</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">            
<span class='line'>448</span>             </span><span class="COMM">/**
<span class='line'>449</span>              * 当标题列改变大小过程中不断触发的回调事件列表(仅内部使用)
<span class='line'>450</span>              */</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">            </span><span class="NAME">_onResizableCallbacks</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>452</span> </span><span class="WHIT">            
<span class='line'>453</span>             </span><span class="COMM">/**
<span class='line'>454</span>              * 当调用resize方法动态改变宽高时的回调事件列表
<span class='line'>455</span>              */</span><span class="WHIT"> 
<span class='line'>456</span>             </span><span class="NAME">_onResizeCallbacks</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">        </span><span class="COMM">//private methods</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">        </span><span class="NAME">_create</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="NAME">el</span><span class="PUNC">=</span><span class="NAME">this.element.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">// show if hidden</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">                </span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">                    </span><span class="NAME">cellPadding</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">                    </span><span class="NAME">cellSpacing</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">                    </span><span class="NAME">border</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">                </span><span class="PUNC">.</span><span class="NAME">empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">                </span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="STRN">'&lt;tbody>&lt;/tbody>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">            </span><span class="NAME">el.wrap</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="om-grid om-widget om-widget-content">&lt;div class="bDiv" style="width:auto">&lt;/div>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//如果colModel没设置或值不对，什么也不做</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">            
<span class='line'>473</span>             </span><span class="NAME">this.hDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="hDiv om-state-default">&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="hDivBox">&lt;table cellPadding="0" cellSpacing="0">&lt;/table>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">            </span><span class="NAME">el.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">before</span><span class="PUNC">(</span><span class="NAME">this.hDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">            </span><span class="NAME">this.pDiv</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="pDiv om-state-default">&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">            </span><span class="NAME">el.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">after</span><span class="PUNC">(</span><span class="NAME">this.pDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">            
<span class='line'>478</span>             </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">            </span><span class="NAME">this.loadMask</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="gBlock">&lt;div align="center" class="gBlock-valignMiddle" >&lt;div class="loadingImg" style="display:block"/>&lt;/div>&lt;/div>'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT">                    </span><span class="PUNC">.</span><span class="NAME">mousedown</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>481</span> </span><span class="WHIT">                        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//禁用双击（默认双击全把div下面的内容全选）</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">                    </span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>484</span> </span><span class="WHIT">            </span><span class="NAME">grid.append</span><span class="PUNC">(</span><span class="NAME">this.loadMask</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT">            
<span class='line'>486</span>             </span><span class="NAME">this.titleDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;div class='titleDiv'>&lt;/div>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">            </span><span class="NAME">grid.prepend</span><span class="PUNC">(</span><span class="NAME">this.titleDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>488</span> </span><span class="WHIT">            
<span class='line'>489</span>             </span><span class="NAME">this.tbody</span><span class="PUNC">=</span><span class="NAME">this.element.children</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">eq</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT">            </span><span class="NAME">this._guid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="COMM">//对于每一行都添加一个 "_row_id"以进行唯一标识</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT">            
<span class='line'>492</span>             </span><span class="NAME">options._onRefreshCallbacks.push</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT">            	</span><span class="NAME">this._refreshHeaderCheckBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>495</span> </span><span class="WHIT">            
<span class='line'>496</span>             </span><span class="COMM">//事件绑定</span><span class="WHIT">
<span class='line'>497</span> </span><span class="WHIT">            </span><span class="NAME">this._bindScrollEnvent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>498</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>499</span> </span><span class="WHIT">        </span><span class="NAME">_init</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$el</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT">        		</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT">                </span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT">            
<span class='line'>504</span>             </span><span class="NAME">this._measure</span><span class="PUNC">(</span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ops</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>505</span> 
<span class='line'>506</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//如果colModel没设置或值不对，什么也不做</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">            </span><span class="COMM">//远程取数时额外带的参数，注意，这仅供内部使用，外部使用的是 this.options.extraData</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT">            </span><span class="NAME">this._extraData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">            
<span class='line'>512</span>             </span><span class="NAME">this.tbody.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'table'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.hDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">            </span><span class="NAME">this.pDiv.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">            </span><span class="NAME">this.titleDiv.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT">            </span><span class="NAME">this._buildTableHead</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">            </span><span class="NAME">this._buildPagingToolBar</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">            </span><span class="NAME">this._buildLoadMask</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">            </span><span class="NAME">this._bindSelectAndClickEnvent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT">            </span><span class="NAME">this._makeColsResizable</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT">            </span><span class="NAME">this._buildTitle</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">            
<span class='line'>523</span>             </span><span class="NAME">this._resetHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">            </span><span class="NAME">this.pageData</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="NAME">nowPage</span><span class="PUNC">:</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="NAME">totalPages</span><span class="PUNC">:</span><span class="NUMB">1</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">            </span><span class="NAME">this._populate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>528</span> 		 * 改变组件的大小。
<span class='line'>529</span> 		 * @name omGrid#resize
<span class='line'>530</span> 		 * @function
<span class='line'>531</span> 		 * @param position (1)可以为Object,格式如{width:500,height:250} &lt;br/>
<span class='line'>532</span> 		 *                 (2)只有一个参数表示width,有两个参数时依次表示width,height
<span class='line'>533</span> 		 * @example
<span class='line'>534</span> 		 * $(".selector").omGrid("resize" , 500);&lt;br />//把宽度改为500像素。
<span class='line'>535</span> 		 * $(".selector").omGrid("resize" , 500 , 250);&lt;br />//把宽度改为500像素，高度改为250像素。
<span class='line'>536</span> 		 * $(".selector").omGrid("resize" , {height:300});&lt;br />//把高度改为300像素。
<span class='line'>537</span> 		 * $(".selector").omGrid("resize" , {width:'fit',height:'fit'});&lt;br />//把宽度和高度同时改为自适应父容器大小。
<span class='line'>538</span> 		 * 
<span class='line'>539</span> 		 */</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">        </span><span class="NAME">resize</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">position</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">        		</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">        		</span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> 
<span class='line'>545</span> </span><span class="WHIT">		 	</span><span class="NAME">position</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">position</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">		 	</span><span class="NAME">ops.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">position.width</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">ops.width</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT">		 	</span><span class="NAME">ops.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">position.height</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">ops.height</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">		 	
<span class='line'>549</span> 		 	</span><span class="NAME">this._measure</span><span class="PUNC">(</span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ops</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>550</span> </span><span class="WHIT">		 	</span><span class="NAME">this._buildLoadMask</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">            </span><span class="NAME">this._resetWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>552</span> </span><span class="WHIT">            </span><span class="NAME">this._resetHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>553</span> </span><span class="WHIT">            </span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">ops._onResizeCallbacks</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>554</span> </span><span class="WHIT">            	</span><span class="NAME">fn.call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>555</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>556</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>557</span> </span><span class="WHIT">        </span><span class="NAME">_measure</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ops</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>558</span> </span><span class="WHIT">        	</span><span class="NAME">$grid.outerWidth</span><span class="PUNC">(</span><span class="NAME">ops.width</span><span class="PUNC">===</span><span class="STRN">'fit'</span><span class="PUNC">?</span><span class="NAME">$grid.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">ops.width</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  
<span class='line'>559</span>             </span><span class="NAME">$grid.outerHeight</span><span class="PUNC">(</span><span class="NAME">ops.height</span><span class="PUNC">===</span><span class="STRN">'fit'</span><span class="PUNC">?</span><span class="NAME">$grid.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">ops.height</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>560</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>561</span> </span><span class="WHIT">        </span><span class="NAME">_resetHeight</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>562</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>563</span> </span><span class="WHIT">                </span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>564</span> </span><span class="WHIT">        	
<span class='line'>565</span>         	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">headerHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.hDiv.outerHeight</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>566</span> </span><span class="WHIT">                </span><span class="NAME">pagerHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pDiv.is</span><span class="PUNC">(</span><span class="STRN">":hidden"</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.pDiv.outerHeight</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>567</span> </span><span class="WHIT">                </span><span class="NAME">titleHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.titleDiv.is</span><span class="PUNC">(</span><span class="STRN">":hidden"</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.titleDiv.outerHeight</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>568</span> </span><span class="WHIT">                
<span class='line'>569</span>             </span><span class="NAME">$grid.children</span><span class="PUNC">(</span><span class="STRN">'.bDiv'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">outerHeight</span><span class="PUNC">(</span><span class="NAME">$grid.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">headerHeight</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">pagerHeight</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">titleHeight</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>570</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>571</span> </span><span class="WHIT">        </span><span class="NAME">_resetWidth</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>572</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>573</span> </span><span class="WHIT">        		</span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>574</span> </span><span class="WHIT">        		</span><span class="NAME">$thead</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'thead'</span><span class="PUNC">,</span><span class="NAME">this.hDiv</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT">        		</span><span class="NAME">allColsWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>576</span> </span><span class="WHIT">        		
<span class='line'>577</span>         	</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">cms</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cm</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>578</span> </span><span class="WHIT">        		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cmWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cm.width</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>579</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">cm.width</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'autoExpand'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>580</span> </span><span class="WHIT">                    </span><span class="NAME">cmWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>581</span> </span><span class="WHIT">                    </span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>582</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT">                </span><span class="NAME">$thead.find</span><span class="PUNC">(</span><span class="STRN">"th[axis='col"</span><span class="PUNC">+</span><span class="NAME">index</span><span class="PUNC">+</span><span class="STRN">"'] >div"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">cmWidth</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">				</span><span class="NAME">allColsWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cmWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>585</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>586</span> </span><span class="WHIT">        	
<span class='line'>587</span>         	</span><span class="NAME">this._fixHeaderWidth</span><span class="PUNC">(</span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">allColsWidth</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT">        	
<span class='line'>589</span>             </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">headerWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">this._getHeaderCols</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT">            	</span><span class="NAME">headerWidth</span><span class="PUNC">[</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"abbr"</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>592</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>593</span> </span><span class="WHIT">            
<span class='line'>594</span>             </span><span class="COMM">//修正body中各个td宽度</span><span class="WHIT">
<span class='line'>595</span> </span><span class="WHIT">            </span><span class="NAME">this.tbody.find</span><span class="PUNC">(</span><span class="STRN">"td[abbr]"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">td</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT">            	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">td</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">prop</span><span class="PUNC">(</span><span class="STRN">"abbr"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">headerWidth</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>598</span> </span><span class="WHIT">            		</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">td</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">find</span><span class="PUNC">(</span><span class="STRN">">div:first"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">headerWidth</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>599</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>600</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>601</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>602</span>         </span><span class="NAME">_getColModel</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>603</span> </span><span class="WHIT">        	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.options.colModel</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT">        </span><span class="NAME">_buildTitle</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$title</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.titleDiv</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.options.title</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT">                </span><span class="NAME">$title.html</span><span class="PUNC">(</span><span class="STRN">"&lt;div class='titleContent'>"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.options.title</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"&lt;/div>"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>609</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT">            	</span><span class="NAME">$title.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">        </span><span class="NAME">_fixHeaderWidth</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">allColsWidth</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">        		</span><span class="NAME">$thead</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'thead'</span><span class="PUNC">,</span><span class="NAME">this.hDiv</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">        		</span><span class="NAME">cms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">        		</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">        	
<span class='line'>619</span>         	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//说明有某列要自动扩充</span><span class="WHIT">
<span class='line'>620</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tableWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$grid.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">32</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">                	</span><span class="NAME">toBeExpandedTh</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$thead.find</span><span class="PUNC">(</span><span class="STRN">'th[axis="col'</span><span class="PUNC">+</span><span class="NAME">autoExpandColIndex</span><span class="PUNC">+</span><span class="STRN">'"] div'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT">                	
<span class='line'>623</span>                 </span><span class="COMM">//虽然toBeExpandedTh.parent().width()为0,但不同浏览器在计算下边的thead.width()竟然有差异(Chrome)，所以干脆先隐藏了，保证所有浏览器计算thead.width()值一致</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">                </span><span class="NAME">toBeExpandedTh.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">usableWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tableWidth</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$thead.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">                </span><span class="NAME">toBeExpandedTh.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">usableWidth</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT">                    </span><span class="NAME">toBeExpandedTh.css</span><span class="PUNC">(</span><span class="STRN">'width'</span><span class="PUNC">,</span><span class="NUMB">60</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT">                    </span><span class="NAME">toBeExpandedTh.css</span><span class="PUNC">(</span><span class="STRN">'width'</span><span class="PUNC">,</span><span class="NAME">usableWidth</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>632</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">ops.autoFit</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>633</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tableWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$grid.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">22</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>634</span> </span><span class="WHIT">                    </span><span class="NAME">usableWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tableWidth</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$thead.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>635</span> </span><span class="WHIT">                    </span><span class="NAME">percent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">usableWidth</span><span class="PUNC">/</span><span class="NAME">allColsWidth</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>636</span> </span><span class="WHIT">                    </span><span class="NAME">toFixedThs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$thead.find</span><span class="PUNC">(</span><span class="STRN">'th[axis^="col"] >div'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>637</span> </span><span class="WHIT">                 
<span class='line'>638</span>                 </span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">cms</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>639</span> </span><span class="WHIT">                	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$th</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">toFixedThs.eq</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>640</span> </span><span class="WHIT">                    </span><span class="NAME">$th.width</span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">$th.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">*</span><span class="NAME">percent</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>641</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> 
<span class='line'>642</span>             </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>643</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>644</span> </span><span class="WHIT">        </span><span class="NAME">_buildTableHead</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>645</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>646</span> </span><span class="WHIT">                </span><span class="NAME">el</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>647</span> </span><span class="WHIT">                </span><span class="NAME">grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>648</span> </span><span class="WHIT">                </span><span class="NAME">cms</span><span class="PUNC">=</span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>649</span> </span><span class="WHIT">                </span><span class="NAME">allColsWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">//colModel的宽度</span><span class="WHIT">
<span class='line'>650</span> </span><span class="WHIT">                </span><span class="NAME">indexWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">//colModel的宽度</span><span class="WHIT">
<span class='line'>651</span> </span><span class="WHIT">                </span><span class="NAME">checkboxWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">//colModel的宽度</span><span class="WHIT">
<span class='line'>652</span> </span><span class="WHIT">                </span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>653</span> </span><span class="WHIT">                </span><span class="NAME">thead</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;thead>&lt;/thead>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>654</span> </span><span class="WHIT">                </span><span class="NAME">tr</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;tr>&lt;/tr>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">thead</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>655</span> </span><span class="WHIT">            </span><span class="COMM">//渲染序号列</span><span class="WHIT">
<span class='line'>656</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">op.showIndex</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>657</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cell</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;th>&lt;/th>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">axis</span><span class="PUNC">:</span><span class="STRN">'indexCol'</span><span class="PUNC">,</span><span class="NAME">align</span><span class="PUNC">:</span><span class="STRN">'center'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'indexCol'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="indexheader" style="text-align:center;width:25px;">&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>658</span> </span><span class="WHIT">                </span><span class="NAME">tr.append</span><span class="PUNC">(</span><span class="NAME">cell</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>659</span> </span><span class="WHIT">                </span><span class="NAME">indexWidth</span><span class="PUNC">=</span><span class="NUMB">25</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>660</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>661</span> </span><span class="WHIT">            </span><span class="COMM">//渲染checkbox列</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">op.singleSelect</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>663</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cell</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;th>&lt;/th>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">axis</span><span class="PUNC">:</span><span class="STRN">'checkboxCol'</span><span class="PUNC">,</span><span class="NAME">align</span><span class="PUNC">:</span><span class="STRN">'center'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'checkboxCol'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="checkboxheader" style="text-align:center;width:17px;">&lt;span class="checkbox"/>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>664</span> </span><span class="WHIT">                </span><span class="NAME">tr.append</span><span class="PUNC">(</span><span class="NAME">cell</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>665</span> </span><span class="WHIT">                </span><span class="NAME">checkboxWidth</span><span class="PUNC">=</span><span class="NUMB">17</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>666</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>667</span> </span><span class="WHIT">            </span><span class="COMM">//渲染colModel各列</span><span class="WHIT">
<span class='line'>668</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">cms.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>669</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cm</span><span class="PUNC">=</span><span class="NAME">cms</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NAME">cmWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cm.width</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">,</span><span class="NAME">cmAlign</span><span class="PUNC">=</span><span class="NAME">cm.align</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>670</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">cmWidth</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'autoExpand'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>671</span> </span><span class="WHIT">                    </span><span class="NAME">cmWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">                    </span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>673</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>674</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">thCell</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">cm.header</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'text-align'</span><span class="PUNC">:</span><span class="NAME">cmAlign</span><span class="PUNC">,</span><span class="NAME">width</span><span class="PUNC">:</span><span class="NAME">cmWidth</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT">                </span><span class="NAME">cm.wrap</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">thCell.addClass</span><span class="PUNC">(</span><span class="STRN">'wrap'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">th</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;th>&lt;/th>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'axis'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'col'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'col'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">thCell</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>677</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">cm.name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>678</span> </span><span class="WHIT">                    </span><span class="NAME">th.attr</span><span class="PUNC">(</span><span class="STRN">'abbr'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cm.name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>679</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>680</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">cm.align</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>681</span> </span><span class="WHIT">                    </span><span class="NAME">th.attr</span><span class="PUNC">(</span><span class="STRN">'align'</span><span class="PUNC">,</span><span class="NAME">cm.align</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>682</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>683</span> </span><span class="WHIT">                </span><span class="COMM">//var _div=$('&lt;div>&lt;/div>').html(cm.header).attr('width', cmWidth);</span><span class="WHIT">
<span class='line'>684</span> </span><span class="WHIT">                </span><span class="NAME">allColsWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cmWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>685</span> </span><span class="WHIT">                </span><span class="NAME">tr.append</span><span class="PUNC">(</span><span class="NAME">th</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>686</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>687</span> </span><span class="WHIT">            </span><span class="COMM">//tr.append($('&lt;th>&lt;/th'));</span><span class="WHIT">
<span class='line'>688</span> </span><span class="WHIT">            </span><span class="NAME">el.prepend</span><span class="PUNC">(</span><span class="NAME">thead</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>689</span> </span><span class="WHIT">            
<span class='line'>690</span>             
<span class='line'>691</span>             </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'table'</span><span class="PUNC">,</span><span class="NAME">this.hDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">thead</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>692</span> </span><span class="WHIT">            </span><span class="NAME">this._fixHeaderWidth</span><span class="PUNC">(</span><span class="NAME">autoExpandColIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">allColsWidth</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>693</span> </span><span class="WHIT">            </span><span class="NAME">this.thead</span><span class="PUNC">=</span><span class="NAME">thead</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT">            </span><span class="NAME">thead</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>695</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>696</span> </span><span class="WHIT">        </span><span class="NAME">_buildPagingToolBar</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>697</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>698</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">op.limit</span><span class="PUNC">&lt;=</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">            	</span><span class="NAME">this.pDiv.css</span><span class="PUNC">(</span><span class="STRN">"border-width"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">            	</span><span class="NAME">this.pager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pDiv</span><span class="PUNC">;</span><span class="COMM">//即使不出现分页条，这里仍然指定其引用，这样有些地方可以不用每次都要判断是否要分页</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>703</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">                </span><span class="NAME">el</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">                </span><span class="NAME">pDiv</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pDiv</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">           
<span class='line'>707</span>             </span><span class="NAME">pDiv.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="pDiv2">'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">                    </span><span class="STRN">'&lt;div class="pGroup">'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">                    </span><span class="STRN">'&lt;div class="pFirst pButton om-icon">&lt;span class="om-icon-seek-start">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">                    </span><span class="STRN">'&lt;div class="pPrev pButton om-icon">&lt;span class="om-icon-seek-prev">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>712</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="btnseparator">&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="pGroup">&lt;span class="pControl">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="btnseparator">&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>715</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="pGroup">'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>716</span> </span><span class="WHIT">                    </span><span class="STRN">'&lt;div class="pNext pButton om-icon">&lt;span class="om-icon-seek-next">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>717</span> </span><span class="WHIT">                    </span><span class="STRN">'&lt;div class="pLast pButton om-icon">&lt;span class="om-icon-seek-end">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>718</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>719</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="btnseparator">&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>720</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="pGroup">'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>721</span> </span><span class="WHIT">                    </span><span class="STRN">'&lt;div class="pReload pButton om-icon">&lt;span class="om-icon-refresh">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>722</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>723</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="btnseparator">&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>724</span> </span><span class="WHIT">                </span><span class="STRN">'&lt;div class="pGroup">&lt;span class="pPageStat">&lt;/span>&lt;/div>'</span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>725</span> </span><span class="WHIT">            	</span><span class="STRN">'&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>726</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pageText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omGrid"</span><span class="PUNC">,</span><span class="STRN">"pageText"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/{totalPage}/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'&lt;span>1&lt;/span>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/{index}/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'&lt;input type="text" size="4" value="1" />'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>727</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pControl'</span><span class="PUNC">,</span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">pageText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>728</span> </span><span class="WHIT">            </span><span class="NAME">el.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">after</span><span class="PUNC">(</span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>729</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pReload'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>730</span> </span><span class="WHIT">                </span><span class="NAME">self._populate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>731</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>732</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pFirst'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT">                </span><span class="NAME">self._changePage</span><span class="PUNC">(</span><span class="STRN">'first'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pPrev'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT">                </span><span class="NAME">self._changePage</span><span class="PUNC">(</span><span class="STRN">'prev'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>737</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>738</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pNext'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT">                </span><span class="NAME">self._changePage</span><span class="PUNC">(</span><span class="STRN">'next'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>741</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pLast'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>742</span> </span><span class="WHIT">                </span><span class="NAME">self._changePage</span><span class="PUNC">(</span><span class="STRN">'last'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>743</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>744</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pControl input'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">keydown</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>745</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.keyCode</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">$.om.keyCode.ENTER</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT">					</span><span class="NAME">self._changePage</span><span class="PUNC">(</span><span class="STRN">'input'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>747</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>748</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pButton'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hover</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>750</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>751</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT">            </span><span class="NAME">this.pager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pDiv</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT">        </span><span class="NAME">_buildLoadMask</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT">            </span><span class="NAME">this.loadMask.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">width</span><span class="PUNC">:</span><span class="STRN">"100%"</span><span class="PUNC">,</span><span class="NAME">height</span><span class="PUNC">:</span><span class="NAME">grid.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>760</span> </span><span class="WHIT">        </span><span class="NAME">_changePage</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">ctype</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// change page</span><span class="WHIT">
<span class='line'>761</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.loading</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>762</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">el</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>765</span> </span><span class="WHIT">                </span><span class="NAME">pageData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pageData</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>766</span> </span><span class="WHIT">                </span><span class="NAME">nowPage</span><span class="PUNC">=</span><span class="NAME">pageData.nowPage</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>767</span> </span><span class="WHIT">                </span><span class="NAME">totalPages</span><span class="PUNC">=</span><span class="NAME">pageData.totalPages</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>768</span> </span><span class="WHIT">                </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowPage</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT">            </span><span class="NAME">this._oldPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowPage</span><span class="PUNC">;</span><span class="COMM">//保存好旧的页数，有些插件如sort是需要用到的</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT">            </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ctype</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'first'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT">                    </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>773</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>774</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'prev'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>775</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowPage</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>776</span> </span><span class="WHIT">                        </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowPage</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>777</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>779</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'next'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>780</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowPage</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">totalPages</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>781</span> </span><span class="WHIT">                        </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowPage</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>782</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>783</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>784</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'last'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>785</span> </span><span class="WHIT">                    </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">totalPages</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>786</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>787</span> </span><span class="WHIT">                </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'input'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>788</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pControl input'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>789</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">nv</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>790</span> </span><span class="WHIT">                        </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowPage</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>791</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>792</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>793</span> </span><span class="WHIT">                        </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>794</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">totalPages</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>795</span> </span><span class="WHIT">                        </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">totalPages</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>796</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>797</span> </span><span class="WHIT">                    </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pControl input'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.pDiv</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">val</span><span class="PUNC">(</span><span class="NAME">nv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>798</span> </span><span class="WHIT">                    </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nv</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>799</span> </span><span class="WHIT">                    </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>800</span> </span><span class="WHIT">                </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>801</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/\d/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ctype</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>802</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">ctype</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>803</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">nv</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>804</span> </span><span class="WHIT">                            </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>805</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>806</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>807</span> </span><span class="WHIT">                            </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>808</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">totalPages</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>809</span> </span><span class="WHIT">                            </span><span class="NAME">nv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">totalPages</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>810</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>811</span> </span><span class="WHIT">                        </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pControl input'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">val</span><span class="PUNC">(</span><span class="NAME">nv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>812</span> </span><span class="WHIT">                        </span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nv</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>813</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>814</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>815</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">newPage</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">nowPage</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>816</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>817</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>818</span> </span><span class="WHIT">            </span><span class="COMM">//触发事件</span><span class="WHIT">
<span class='line'>819</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._trigger</span><span class="PUNC">(</span><span class="STRN">"onPageChange"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">ctype</span><span class="PUNC">,</span><span class="NAME">newPage</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>820</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>821</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>822</span> </span><span class="WHIT">            </span><span class="COMM">//修改pageData</span><span class="WHIT">
<span class='line'>823</span> </span><span class="WHIT">            </span><span class="NAME">pageData.nowPage</span><span class="PUNC">=</span><span class="NAME">newPage</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>824</span> </span><span class="WHIT">            </span><span class="COMM">//刷新数据</span><span class="WHIT">
<span class='line'>825</span> </span><span class="WHIT">            </span><span class="NAME">this._populate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>826</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>827</span> </span><span class="WHIT">        </span><span class="COMM">//刷新数据</span><span class="WHIT">
<span class='line'>828</span> </span><span class="WHIT">        </span><span class="NAME">_populate</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// get latest data</span><span class="WHIT">
<span class='line'>829</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>830</span> </span><span class="WHIT">                </span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>831</span> </span><span class="WHIT">                </span><span class="NAME">grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>832</span> </span><span class="WHIT">                </span><span class="NAME">op</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>833</span> </span><span class="WHIT">                </span><span class="NAME">pageStat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pPageStat'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">grid</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>834</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">op.dataSource</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pPageStat'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">grid</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">op.emptygMsg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>838</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.loading</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>839</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>840</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>841</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pageData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pageData</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>842</span> </span><span class="WHIT">                </span><span class="NAME">nowPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pageData.nowPage</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT">                </span><span class="NAME">loadMask</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.gBlock'</span><span class="PUNC">,</span><span class="NAME">grid</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT">            </span><span class="COMM">//具备加载数据的前提条件了，准备加载</span><span class="WHIT">
<span class='line'>845</span> </span><span class="WHIT">            </span><span class="NAME">this.loading</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>846</span> </span><span class="WHIT">            </span><span class="NAME">pageStat.html</span><span class="PUNC">(</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omGrid"</span><span class="PUNC">,</span><span class="STRN">"loadingMsg"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>847</span> </span><span class="WHIT">            </span><span class="NAME">loadMask.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>848</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">limit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">op.limit</span><span class="PUNC">&lt;=</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="NUMB">100000000</span><span class="PUNC">:</span><span class="NAME">op.limit</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>849</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">param</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">,</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="NAME">this._extraData</span><span class="PUNC">,</span><span class="NAME">op.extraData</span><span class="PUNC">,</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>850</span> </span><span class="WHIT">                </span><span class="NAME">start</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">limit</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowPage</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>851</span> </span><span class="WHIT">                </span><span class="NAME">limit</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">limit</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>852</span> </span><span class="WHIT">                </span><span class="NAME">_time_stamp_</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>853</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>854</span> </span><span class="WHIT">            </span><span class="NAME">$.ajax</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>855</span> </span><span class="WHIT">                </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">op.method</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT">                </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">op.dataSource</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>857</span> </span><span class="WHIT">                </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">param</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>858</span> </span><span class="WHIT">                </span><span class="NAME">dataType</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'json'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>859</span> </span><span class="WHIT">                </span><span class="NAME">success</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="NAME">request</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>860</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">op.onSuccess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>861</span> </span><span class="WHIT">                        </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onSuccess"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="NAME">request</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>862</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>863</span> </span><span class="WHIT">                    </span><span class="NAME">self._addData</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>864</span> </span><span class="WHIT">                    </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">op._onRefreshCallbacks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>865</span> </span><span class="WHIT">                    	</span><span class="NAME">op._onRefreshCallbacks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>866</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>867</span> </span><span class="WHIT">                    </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onRefresh"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">nowPage</span><span class="PUNC">,</span><span class="NAME">data.rows</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>868</span> </span><span class="WHIT">                    </span><span class="NAME">loadMask.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>869</span> </span><span class="WHIT">                    </span><span class="NAME">self.loading</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>870</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>871</span> </span><span class="WHIT">                </span><span class="NAME">error</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorThrown</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>872</span> </span><span class="WHIT">                    </span><span class="NAME">pageStat.html</span><span class="PUNC">(</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omGrid"</span><span class="PUNC">,</span><span class="STRN">"errorMsg"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">'color'</span><span class="PUNC">,</span><span class="STRN">'red'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>873</span> </span><span class="WHIT">                    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>874</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">onError</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">op.onError</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>875</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">onError</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>876</span> </span><span class="WHIT">                            </span><span class="NAME">onError</span><span class="PUNC">(</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorThrown</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>877</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>878</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>879</span> </span><span class="WHIT">                        </span><span class="COMM">// do nothing </span><span class="WHIT">
<span class='line'>880</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">finally</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>881</span> </span><span class="WHIT">                        </span><span class="NAME">loadMask.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>882</span> </span><span class="WHIT">                        </span><span class="NAME">self.loading</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>883</span> </span><span class="WHIT">                        </span><span class="NAME">self.pageData.data</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="NAME">rows</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NAME">total</span><span class="PUNC">:</span><span class="NUMB">0</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="COMM">//出错时重新设置，不然self.pageData.data可能为undefined，其它地方就要做多余空处理</span><span class="WHIT">
<span class='line'>884</span> </span><span class="WHIT">                        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>885</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>886</span> </span><span class="WHIT">                    
<span class='line'>887</span>                 </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>888</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>889</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">        </span><span class="NAME">_addData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>891</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>892</span> </span><span class="WHIT">                </span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>893</span> </span><span class="WHIT">                </span><span class="NAME">grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>894</span> </span><span class="WHIT">                </span><span class="NAME">preProcess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">op.preProcess</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>895</span> </span><span class="WHIT">                </span><span class="NAME">pageData</span><span class="PUNC">=</span><span class="NAME">this.pageData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>896</span> </span><span class="WHIT">            </span><span class="COMM">//预处理</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">            </span><span class="NAME">preProcess</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">=</span><span class="NAME">preProcess</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">            </span><span class="NAME">pageData.data</span><span class="PUNC">=</span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">            </span><span class="NAME">pageData.totalPages</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.ceil</span><span class="PUNC">(</span><span class="NAME">data.total</span><span class="PUNC">/</span><span class="NAME">op.limit</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">            </span><span class="COMM">//刷新分页条</span><span class="WHIT">
<span class='line'>901</span> </span><span class="WHIT">            </span><span class="NAME">this._buildPager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>902</span> </span><span class="WHIT">            </span><span class="NAME">this._renderDatas</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>903</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>904</span> </span><span class="WHIT">        </span><span class="NAME">_buildPager</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>905</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>906</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">op.limit</span><span class="PUNC">&lt;=</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>907</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>908</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>909</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pager</span><span class="PUNC">=</span><span class="NAME">this.pager</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>910</span> </span><span class="WHIT">                </span><span class="NAME">pControl</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pControl'</span><span class="PUNC">,</span><span class="NAME">pager</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>911</span> </span><span class="WHIT">                </span><span class="NAME">pageData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pageData</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>912</span> </span><span class="WHIT">                </span><span class="NAME">nowPage</span><span class="PUNC">=</span><span class="NAME">pageData.nowPage</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>913</span> </span><span class="WHIT">                </span><span class="NAME">totalPages</span><span class="PUNC">=</span><span class="NAME">pageData.totalPages</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>914</span> </span><span class="WHIT">                </span><span class="NAME">data</span><span class="PUNC">=</span><span class="NAME">pageData.data</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>915</span> </span><span class="WHIT">                </span><span class="NAME">from</span><span class="PUNC">=</span><span class="NAME">op.limit</span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowPage</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>916</span> </span><span class="WHIT">                </span><span class="NAME">to</span><span class="PUNC">=</span><span class="NAME">from</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">+</span><span class="NAME">data.rows.length</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>917</span> </span><span class="WHIT">                </span><span class="NAME">pageStat</span><span class="PUNC">=</span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>918</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">data.total</span><span class="PUNC">===</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>919</span> </span><span class="WHIT">                </span><span class="NAME">pageStat</span><span class="PUNC">=</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omGrid"</span><span class="PUNC">,</span><span class="STRN">"emptyMsg"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>920</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>921</span> </span><span class="WHIT">                </span><span class="NAME">pageStat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omGrid"</span><span class="PUNC">,</span><span class="STRN">"pageStat"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/{from}/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/{to}/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">to</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/{total}/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data.total</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>922</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>923</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'input'</span><span class="PUNC">,</span><span class="NAME">pControl</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">val</span><span class="PUNC">(</span><span class="NAME">nowPage</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>924</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'span'</span><span class="PUNC">,</span><span class="NAME">pControl</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">totalPages</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>925</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pPageStat'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pager</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">pageStat</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>926</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>927</span> </span><span class="WHIT">        </span><span class="NAME">_renderDatas</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>928</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>929</span> </span><span class="WHIT">                </span><span class="NAME">el</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>930</span> </span><span class="WHIT">                </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>931</span> </span><span class="WHIT">                </span><span class="NAME">gridHeaderCols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getHeaderCols</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>932</span> </span><span class="WHIT">                </span><span class="NAME">rows</span><span class="PUNC">=</span><span class="NAME">this.pageData.data.rows</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>933</span> </span><span class="WHIT">                </span><span class="NAME">colModel</span><span class="PUNC">=</span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>934</span> </span><span class="WHIT">                </span><span class="NAME">rowClasses</span><span class="PUNC">=</span><span class="NAME">op.rowClasses</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>935</span> </span><span class="WHIT">                </span><span class="NAME">tbody</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'tbody'</span><span class="PUNC">,</span><span class="NAME">el</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>936</span> </span><span class="WHIT">                </span><span class="NAME">isRowClassesFn</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">rowClasses</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>937</span> </span><span class="WHIT">                </span><span class="NAME">pageData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pageData</span><span class="PUNC">,</span><span class="NAME">start</span><span class="PUNC">=</span><span class="PUNC">(</span><span class="NAME">pageData.nowPage</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">*</span><span class="NAME">op.limit</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>938</span> </span><span class="WHIT">                </span><span class="NAME">tdTmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"&lt;td align='$' abbr='$' class='$'>&lt;div align='$' class='innerCol $' style='width:$px'>$&lt;/div>&lt;/td>"</span><span class="PUNC">,</span><span class="COMM">//td模板</span><span class="WHIT">
<span class='line'>939</span> </span><span class="WHIT">                </span><span class="NAME">headerWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>940</span> </span><span class="WHIT">                </span><span class="NAME">bodyContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>941</span> </span><span class="WHIT">                </span><span class="NAME">cols</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>942</span> </span><span class="WHIT">                </span><span class="NAME">j</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>943</span> </span><span class="WHIT">            
<span class='line'>944</span>             </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.pageData.data.rows</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>945</span> </span><span class="WHIT">            	</span><span class="NAME">this.pageData.data.rows</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="COMM">//修复</span><span class="WHIT">
<span class='line'>946</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>947</span> </span><span class="WHIT">            </span><span class="NAME">self.hDiv.scrollLeft</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>948</span> </span><span class="WHIT">            
<span class='line'>949</span>             </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">gridHeaderCols</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>950</span> </span><span class="WHIT">            	</span><span class="NAME">headerWidth</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>951</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>952</span> </span><span class="WHIT">    		
<span class='line'>953</span>             </span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">rows</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>954</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowCls</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isRowClassesFn</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">rowClasses</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">rowClasses</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">rowClasses.length</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>955</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowValues</span><span class="PUNC">=</span><span class="NAME">self._buildRowCellValues</span><span class="PUNC">(</span><span class="NAME">colModel</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>956</span> </span><span class="WHIT">                </span><span class="NAME">bodyContent.push</span><span class="PUNC">(</span><span class="STRN">"&lt;tr _grid_row_id="</span><span class="PUNC">+</span><span class="PUNC">(</span><span class="NAME">self._guid</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="STRN">" class='om-grid-row "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">rowCls</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>957</span> </span><span class="WHIT">               
<span class='line'>958</span>                	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">gridHeaderCols</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>959</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'axis'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">wrap</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="NAME">html</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>960</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'indexCol'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>961</span> </span><span class="WHIT">                        </span><span class="NAME">html</span><span class="PUNC">=</span><span class="NAME">i</span><span class="PUNC">+</span><span class="NAME">start</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>962</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'checkboxCol'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>963</span> </span><span class="WHIT">                        </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'&lt;span class="checkbox"/>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>964</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis.substring</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">==</span><span class="STRN">'col'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>965</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colIndex</span><span class="PUNC">=</span><span class="NAME">axis.substring</span><span class="PUNC">(</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>966</span> </span><span class="WHIT">                        </span><span class="NAME">html</span><span class="PUNC">=</span><span class="NAME">rowValues</span><span class="PUNC">[</span><span class="NAME">colIndex</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>967</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">colModel</span><span class="PUNC">[</span><span class="NAME">colIndex</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">wrap</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>968</span> </span><span class="WHIT">							</span><span class="NAME">wrap</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>969</span> </span><span class="WHIT">						</span><span class="PUNC">}</span><span class="WHIT"> 
<span class='line'>970</span>                     </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>971</span> </span><span class="WHIT">                        </span><span class="NAME">html</span><span class="PUNC">=</span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>972</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>973</span> </span><span class="WHIT">                    </span><span class="NAME">cols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.align</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.abbr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.align</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">wrap</span><span class="PUNC">?</span><span class="STRN">'wrap'</span><span class="PUNC">:</span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">headerWidth</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>974</span> </span><span class="WHIT">                    </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>975</span> </span><span class="WHIT">                    </span><span class="NAME">bodyContent.push</span><span class="PUNC">(</span><span class="NAME">tdTmp.replace</span><span class="PUNC">(</span><span class="REGX">/\$/g</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>976</span> </span><span class="WHIT">                    	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">cols</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>977</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>978</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>979</span> </span><span class="WHIT">                </span><span class="NAME">bodyContent.push</span><span class="PUNC">(</span><span class="STRN">"&lt;/tr>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>980</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>981</span> </span><span class="WHIT">           	</span><span class="NAME">tbody.html</span><span class="PUNC">(</span><span class="NAME">bodyContent.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> 
<span class='line'>982</span>         </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>983</span> </span><span class="WHIT">        </span><span class="NAME">_getHeaderCols</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>984</span> </span><span class="WHIT">        	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hDiv.find</span><span class="PUNC">(</span><span class="STRN">"th[axis]"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>985</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>986</span> </span><span class="WHIT">        </span><span class="NAME">_buildRowCellValues</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">colModel</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">rowIndex</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>987</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">colModel.length</span><span class="PUNC">,</span><span class="NAME">values</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>988</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">c</span><span class="PUNC">=</span><span class="NAME">colModel</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>990</span> </span><span class="WHIT">                	</span><span class="NAME">v</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>991</span> </span><span class="WHIT">                	</span><span class="NAME">r</span><span class="PUNC">=</span><span class="NAME">c.renderer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>992</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">c.name.indexOf</span><span class="PUNC">(</span><span class="STRN">"."</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>993</span> </span><span class="WHIT">                	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">properties</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">c.name.split</span><span class="PUNC">(</span><span class="STRN">"."</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>994</span> </span><span class="WHIT">                		</span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>995</span> </span><span class="WHIT">                		</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">properties.length</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>996</span> </span><span class="WHIT">                		</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">[</span><span class="NAME">properties</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>997</span> </span><span class="WHIT">                	</span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">&lt;</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">=</span><span class="NAME">v</span><span class="PUNC">[</span><span class="NAME">properties</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>998</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>999</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1000</span> </span><span class="WHIT">                	</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">[</span><span class="NAME">c.name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">[</span><span class="NAME">c.name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1001</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1002</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1003</span> </span><span class="WHIT">                    </span><span class="NAME">v</span><span class="PUNC">=</span><span class="NAME">r</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">,</span><span class="NAME">rowData</span><span class="PUNC">,</span><span class="NAME">rowIndex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1004</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1005</span> </span><span class="WHIT">                </span><span class="NAME">values</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1006</span> </span><span class="WHIT">                </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1007</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1008</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">values</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1009</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1010</span> </span><span class="WHIT">        </span><span class="COMM">//滚动水平滚动条时让表头和表体一起滚动（如果没有这个方法则只有表体滚动，表头不会动，表头和表体就对不齐了）</span><span class="WHIT">
<span class='line'>1011</span> </span><span class="WHIT">        </span><span class="NAME">_bindScrollEnvent</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1012</span> </span><span class="WHIT">            </span><span class="NAME">this.tbody.closest</span><span class="PUNC">(</span><span class="STRN">'.bDiv'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scroll</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1013</span> </span><span class="WHIT">                </span><span class="NAME">self.hDiv.scrollLeft</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scrollLeft</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1014</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1015</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1016</span> </span><span class="WHIT">        </span><span class="COMM">//绑定行选择/行反选/行单击/行双击等事件监听</span><span class="WHIT">
<span class='line'>1017</span> </span><span class="WHIT">        </span><span class="NAME">_bindSelectAndClickEnvent</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1018</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1019</span> </span><span class="WHIT">            </span><span class="NAME">this.tbody.unbind</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1020</span> </span><span class="WHIT">            </span><span class="COMM">//如果有checkbox列则绑定事件</span><span class="WHIT">
<span class='line'>1021</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.options.singleSelect</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//可以多选</span><span class="WHIT">
<span class='line'>1022</span> </span><span class="WHIT">                </span><span class="COMM">// 全选/反选,不需要刷新headerChekcbox的选择状态</span><span class="WHIT">
<span class='line'>1023</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'th.checkboxCol span.checkbox'</span><span class="PUNC">,</span><span class="NAME">this.thead</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1024</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">thCheckbox</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">trSize</span><span class="PUNC">=</span><span class="NAME">self._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">size</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1025</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">thCheckbox.hasClass</span><span class="PUNC">(</span><span class="STRN">'selected'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//说明是要全部取消选择</span><span class="WHIT">
<span class='line'>1026</span> </span><span class="WHIT">                        </span><span class="NAME">thCheckbox.removeClass</span><span class="PUNC">(</span><span class="STRN">'selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1027</span> </span><span class="WHIT">                        </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">trSize</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1028</span> </span><span class="WHIT">                            </span><span class="NAME">self._rowDeSelect</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1029</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1030</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//说明是要全选</span><span class="WHIT">
<span class='line'>1031</span> </span><span class="WHIT">                        </span><span class="NAME">thCheckbox.addClass</span><span class="PUNC">(</span><span class="STRN">'selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1032</span> </span><span class="WHIT">                        </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">trSize</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1033</span> </span><span class="WHIT">                            </span><span class="NAME">self._rowSelect</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1034</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1035</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1036</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1037</span> </span><span class="WHIT">                </span><span class="COMM">//行单击,需要刷新headerChekcbox的选择状态</span><span class="WHIT">
<span class='line'>1038</span> </span><span class="WHIT">                </span><span class="NAME">this.tbody.delegate</span><span class="PUNC">(</span><span class="STRN">'tr.om-grid-row'</span><span class="PUNC">,</span><span class="STRN">'click'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1039</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">=</span><span class="NAME">self._getRowIndex</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1040</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">row.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//已选择</span><span class="WHIT">
<span class='line'>1041</span> </span><span class="WHIT">                        </span><span class="NAME">self._rowDeSelect</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1042</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1043</span> </span><span class="WHIT">                        </span><span class="NAME">self._rowSelect</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1044</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1045</span> </span><span class="WHIT">                    </span><span class="NAME">self._refreshHeaderCheckBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1046</span> </span><span class="WHIT">                    </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onRowClick"</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1047</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1048</span> </span><span class="WHIT">                </span><span class="COMM">//行双击</span><span class="WHIT">
<span class='line'>1049</span> </span><span class="WHIT">                </span><span class="NAME">this.tbody.delegate</span><span class="PUNC">(</span><span class="STRN">'tr.om-grid-row'</span><span class="PUNC">,</span><span class="STRN">'dblclick'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1050</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">=</span><span class="NAME">self._getRowIndex</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1051</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">row.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//已选择</span><span class="WHIT">
<span class='line'>1052</span> </span><span class="WHIT">                        </span><span class="COMM">//do nothing</span><span class="WHIT">
<span class='line'>1053</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1054</span> </span><span class="WHIT">                        </span><span class="NAME">self._rowSelect</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1055</span> </span><span class="WHIT">                        </span><span class="NAME">self._refreshHeaderCheckBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1056</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1057</span> </span><span class="WHIT">                    </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onRowDblClick"</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1058</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1059</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//不可多选</span><span class="WHIT">
<span class='line'>1060</span> </span><span class="WHIT">                </span><span class="COMM">//行单击</span><span class="WHIT">
<span class='line'>1061</span> </span><span class="WHIT">                </span><span class="NAME">this.tbody.delegate</span><span class="PUNC">(</span><span class="STRN">'tr.om-grid-row'</span><span class="PUNC">,</span><span class="STRN">'click'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1062</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">=</span><span class="NAME">self._getRowIndex</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1063</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">row.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//已选择</span><span class="WHIT">
<span class='line'>1064</span> </span><span class="WHIT">                        </span><span class="COMM">// no need to deselect another row and select this row</span><span class="WHIT">
<span class='line'>1065</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1066</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lastSelectedIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getRowIndex</span><span class="PUNC">(</span><span class="NAME">self.tbody.find</span><span class="PUNC">(</span><span class="STRN">'tr.om-state-highlight:not(:hidden)'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1067</span> </span><span class="WHIT">                        </span><span class="PUNC">(</span><span class="NAME">lastSelectedIndex</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">self._rowDeSelect</span><span class="PUNC">(</span><span class="NAME">lastSelectedIndex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1068</span> </span><span class="WHIT">                        </span><span class="NAME">self._rowSelect</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1069</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1070</span> </span><span class="WHIT">                    </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onRowClick"</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1071</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1072</span> </span><span class="WHIT">                
<span class='line'>1073</span>                 </span><span class="COMM">//行双击,因为双击一定会先触发单击，所以对于单选表格双击时这一行一定是选中的，所以不需要强制双击前选中</span><span class="WHIT">
<span class='line'>1074</span> </span><span class="WHIT">                </span><span class="NAME">this.tbody.delegate</span><span class="PUNC">(</span><span class="STRN">'tr.om-grid-row'</span><span class="PUNC">,</span><span class="STRN">'dblclick'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1075</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getRowIndex</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1076</span> </span><span class="WHIT">                    </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onRowDblClick"</span><span class="PUNC">,</span><span class="NAME">event</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1077</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1078</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1079</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1080</span> </span><span class="WHIT">        </span><span class="NAME">_getRowData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1081</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.pageData.data.rows</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1082</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1083</span> </span><span class="WHIT">        </span><span class="NAME">_rowSelect</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1084</span> </span><span class="WHIT">             </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">=</span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">eq</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1085</span> </span><span class="WHIT">                </span><span class="NAME">chk</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'td.checkboxCol span.checkbox'</span><span class="PUNC">,</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1086</span> </span><span class="WHIT">            </span><span class="NAME">tr.addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1087</span> </span><span class="WHIT">            </span><span class="NAME">chk.addClass</span><span class="PUNC">(</span><span class="STRN">'selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1088</span> </span><span class="WHIT">            </span><span class="NAME">this._trigger</span><span class="PUNC">(</span><span class="STRN">"onRowSelect"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">this._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1089</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1090</span> </span><span class="WHIT">        </span><span class="NAME">_rowDeSelect</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1091</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">=</span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">eq</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1092</span> </span><span class="WHIT">                </span><span class="NAME">chk</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'td.checkboxCol span.checkbox'</span><span class="PUNC">,</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1093</span> </span><span class="WHIT">            </span><span class="NAME">tr.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1094</span> </span><span class="WHIT">            </span><span class="NAME">chk.removeClass</span><span class="PUNC">(</span><span class="STRN">'selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1095</span> </span><span class="WHIT">            </span><span class="NAME">this._trigger</span><span class="PUNC">(</span><span class="STRN">"onRowDeselect"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">this._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1096</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1097</span> </span><span class="WHIT">        </span><span class="NAME">_refreshHeaderCheckBox</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1098</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selects</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getSelections</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1099</span> </span><span class="WHIT">        		</span><span class="NAME">$trs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1100</span> </span><span class="WHIT">        		</span><span class="NAME">headerCheckbox</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'th.checkboxCol span.checkbox'</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.thead</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1101</span> </span><span class="WHIT">        		</span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$trs.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1102</span> </span><span class="WHIT">        	</span><span class="COMM">//如果当前页一条数据都没有，那么应该不选中比较合理</span><span class="WHIT">
<span class='line'>1103</span> </span><span class="WHIT">        	</span><span class="NAME">headerCheckbox.toggleClass</span><span class="PUNC">(</span><span class="STRN">'selected'</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">></span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">==</span><span class="NAME">selects.length</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1104</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1105</span> </span><span class="WHIT">        </span><span class="COMM">//让列可以改变宽度（index列和checkbox列不可以改变宽度）</span><span class="WHIT">
<span class='line'>1106</span> </span><span class="WHIT">        </span><span class="NAME">_makeColsResizable</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1107</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1108</span> </span><span class="WHIT">                </span><span class="NAME">bDiv</span><span class="PUNC">=</span><span class="NAME">self.tbody.closest</span><span class="PUNC">(</span><span class="STRN">'.bDiv'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1109</span> </span><span class="WHIT">                </span><span class="NAME">grid</span><span class="PUNC">=</span><span class="NAME">self.element.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1110</span> </span><span class="WHIT">                </span><span class="NAME">$titleDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.titleDiv</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1111</span> </span><span class="WHIT">                </span><span class="NAME">differWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1112</span> </span><span class="WHIT">                
<span class='line'>1113</span>             </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'th[axis^="col"] div'</span><span class="PUNC">,</span><span class="NAME">self.thead</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">omResizable</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1114</span> </span><span class="WHIT">                </span><span class="NAME">handles</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'e'</span><span class="PUNC">,</span><span class="COMM">//只可水平改变大小</span><span class="WHIT">
<span class='line'>1115</span> </span><span class="WHIT">                </span><span class="NAME">containment</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'document'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1116</span> </span><span class="WHIT">                </span><span class="NAME">minWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1117</span> </span><span class="WHIT">                </span><span class="NAME">resize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">ui</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1118</span> </span><span class="WHIT">                	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">callbacks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options._onResizableCallbacks</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1119</span> </span><span class="WHIT">                	</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">callbacks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1120</span> </span><span class="WHIT">                		</span><span class="NAME">callbacks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1121</span> </span><span class="WHIT">                	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1122</span> </span><span class="WHIT">                	
<span class='line'>1123</span>                     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_this</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">abbr</span><span class="PUNC">=</span><span class="NAME">_this.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'abbr'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">dataCells</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'td[abbr="'</span><span class="PUNC">+</span><span class="NAME">abbr</span><span class="PUNC">+</span><span class="STRN">'"] > div'</span><span class="PUNC">,</span><span class="NAME">self.tbody</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">hDiv</span><span class="PUNC">=</span><span class="NAME">self.thead.closest</span><span class="PUNC">(</span><span class="STRN">'.hDiv'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1124</span> </span><span class="WHIT">                    </span><span class="NAME">_this.width</span><span class="PUNC">(</span><span class="NAME">ui.size.width</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">height</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1125</span> </span><span class="WHIT">                    </span><span class="NAME">dataCells.width</span><span class="PUNC">(</span><span class="NAME">ui.size.width</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">height</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1126</span> </span><span class="WHIT">                    </span><span class="NAME">bDiv.height</span><span class="PUNC">(</span><span class="NAME">grid.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="PUNC">(</span><span class="NAME">$titleDiv.is</span><span class="PUNC">(</span><span class="STRN">":hidden"</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="NUMB">0</span><span class="PUNC">:</span><span class="NAME">$titleDiv.outerHeight</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NAME">hDiv.outerHeight</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="PUNC">(</span><span class="NAME">self.pDiv.is</span><span class="PUNC">(</span><span class="STRN">":hidden"</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="NUMB">0</span><span class="PUNC">:</span><span class="NAME">self.pDiv.outerHeight</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1127</span> </span><span class="WHIT">                    </span><span class="NAME">hDiv.scrollLeft</span><span class="PUNC">(</span><span class="NAME">bDiv.scrollLeft</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1128</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1129</span> </span><span class="WHIT">                </span><span class="NAME">start</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">ui</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1130</span> </span><span class="WHIT">                	</span><span class="NAME">differWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1131</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1132</span> </span><span class="WHIT">                </span><span class="NAME">stop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">ui</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1133</span> </span><span class="WHIT">                	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">callbacks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options._onResizableStopCallbacks</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1134</span> </span><span class="WHIT">                		</span><span class="NAME">$th</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1135</span> </span><span class="WHIT">                		</span><span class="NAME">hDiv</span><span class="PUNC">=</span><span class="NAME">self.thead.closest</span><span class="PUNC">(</span><span class="STRN">'.hDiv'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1136</span> </span><span class="WHIT">                	</span><span class="NAME">differWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$th.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">differWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1137</span> </span><span class="WHIT">                	</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">callbacks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1138</span> </span><span class="WHIT">                		</span><span class="NAME">callbacks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$th</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">differWidth</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1139</span> </span><span class="WHIT">                	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1140</span> </span><span class="WHIT">                	</span><span class="NAME">hDiv.scrollLeft</span><span class="PUNC">(</span><span class="NAME">bDiv.scrollLeft</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1141</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1142</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1143</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1144</span> </span><span class="WHIT">        </span><span class="COMM">//单独抽出这个方法是为了更好整合其它grid插件，因为很多插件会对tr进行操作，比如行编辑插件会对tr进行隐藏，所以这里获取行索引要注意不与插件冲突。</span><span class="WHIT">
<span class='line'>1145</span> </span><span class="WHIT">		</span><span class="NAME">_getRowIndex</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1146</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">index</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1147</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1148</span> </span><span class="WHIT">		</span><span class="COMM">//获取所有真正的行，此方法一样可以兼容其它插件。</span><span class="WHIT">
<span class='line'>1149</span> </span><span class="WHIT">		</span><span class="NAME">_getTrs</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1150</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.tbody.find</span><span class="PUNC">(</span><span class="STRN">"tr.om-grid-row:not([_delete]=true)"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">		
<span class='line'>1151</span> 		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1152</span> </span><span class="WHIT">        </span><span class="COMM">//public methods</span><span class="WHIT">
<span class='line'>1153</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>1154</span>          * 修改取数url并立即刷新数据。一般用于查询操作。比如开始时取数url是data.json则后台实际收到data.json?start=0&limit=15这样的请求。查询时使用setData方法将取数url改成data.json?queryString=admin，后台实际收到data.json?queryString=admin&start=0&limit=15这样的请求，后台根据参数queryString来做查询即可。
<span class='line'>1155</span>          * @name omGrid#setData
<span class='line'>1156</span>          * @function
<span class='line'>1157</span>          * @param url 新的数据源url
<span class='line'>1158</span>          * @returns jQuery对象
<span class='line'>1159</span>          * @example
<span class='line'>1160</span>          *  //使用新的url来取数，设置完后会立即开始刷新表格数据。
<span class='line'>1161</span>          *  $('.selector').omGrid('setData', 'newgriddata.json');
<span class='line'>1162</span>          */</span><span class="WHIT">
<span class='line'>1163</span> </span><span class="WHIT">        </span><span class="NAME">setData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1164</span> </span><span class="WHIT">            </span><span class="NAME">this.options.dataSource</span><span class="PUNC">=</span><span class="NAME">url</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1165</span> </span><span class="WHIT">            </span><span class="NAME">this.pageData</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="NAME">nowPage</span><span class="PUNC">:</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="NAME">totalPages</span><span class="PUNC">:</span><span class="NUMB">1</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1166</span> </span><span class="WHIT">            </span><span class="NAME">this._populate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1167</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1168</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>1169</span>          * 获取表格JSON数据。&lt;br/>
<span class='line'>1170</span>          *     
<span class='line'>1171</span>          * @name omGrid#getData
<span class='line'>1172</span>          * @function
<span class='line'>1173</span>          * @returns 如果没有设置preProcess则返回由后台返回来的对象。如果有preProcess则返回处理后的对象
<span class='line'>1174</span>          * @example
<span class='line'>1175</span>          * //获取grid的当前页数据
<span class='line'>1176</span>          * var store = $('.selector').omGrid('getData');
<span class='line'>1177</span>          * 
<span class='line'>1178</span>          * 
<span class='line'>1179</span>          */</span><span class="WHIT">
<span class='line'>1180</span> </span><span class="WHIT">        </span><span class="NAME">getData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1181</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.pageData.data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1182</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1183</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>1184</span>          * 使用getData方法的结果重新渲染数据。&lt;b>注意：该方法并不会发送Ajax请求，而且如果表格当前正在加载数据（loadmask还未消失）的话则什么也不做直接返回&lt;/b>。
<span class='line'>1185</span>          * @name omGrid#refresh
<span class='line'>1186</span>          * @function
<span class='line'>1187</span>          * @returns jQuery对象
<span class='line'>1188</span>          * @example
<span class='line'>1189</span>          * //根据当前grid数据模型中的数据，重新刷新grid
<span class='line'>1190</span>          * $('.selector').omGrid('refresh');//注意refresh没有传入参数
<span class='line'>1191</span>          * 
<span class='line'>1192</span>          */</span><span class="WHIT">
<span class='line'>1193</span> </span><span class="WHIT">        </span><span class="NAME">refresh</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1194</span> </span><span class="WHIT">            </span><span class="COMM">// 修改数据模型后可以用此方法来强制刷新（仅客户端行为,不向后台发送请求）</span><span class="WHIT">
<span class='line'>1195</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.loading</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1196</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1197</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1198</span> </span><span class="WHIT">            </span><span class="NAME">this.loading</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1199</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1200</span> </span><span class="WHIT">			</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.pPageStat'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.pager</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omGrid"</span><span class="PUNC">,</span><span class="STRN">"loadingMsg"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1201</span> </span><span class="WHIT">            </span><span class="NAME">this.loadMask.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1202</span> </span><span class="WHIT">            </span><span class="NAME">this._buildPager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1203</span> </span><span class="WHIT">            </span><span class="NAME">this._renderDatas</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1204</span> </span><span class="WHIT">            </span><span class="NAME">this._trigger</span><span class="PUNC">(</span><span class="STRN">"onRefresh"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">this.pageData.nowPage</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="NAME">this.pageData.data.rows</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1205</span> </span><span class="WHIT">            </span><span class="COMM">//用于行编辑插件</span><span class="WHIT">
<span class='line'>1206</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">op._onRefreshCallbacks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1207</span> </span><span class="WHIT">            	</span><span class="NAME">op._onRefreshCallbacks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1208</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1209</span> </span><span class="WHIT">            </span><span class="NAME">this.loadMask.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1210</span> </span><span class="WHIT">            </span><span class="NAME">this.loading</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1211</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1212</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>1213</span>          * 刷新表格。如果没有参数则刷新当前页，如果有参数则转到参数所表示的页（如果参数不合法会自动进行修正）。&lt;b>注意：该方法会发送Ajax请求，而且如果表格当前正在加载数据（loadmask还未消失）的话则什么也不做直接返回&lt;/b>。
<span class='line'>1214</span>          * @name omGrid#reload
<span class='line'>1215</span>          * @function
<span class='line'>1216</span>          * @param page 要转到的页，参数为空表示刷新当前页。如果参数不是数字或者小于1则自动修正为1，如果参数大于总页数则自动修正为总页数。
<span class='line'>1217</span>          * @returns jQuery对象
<span class='line'>1218</span>          * @example
<span class='line'>1219</span>          * $('.selector').omGrid('reload');//刷新当前页
<span class='line'>1220</span>          * $('.selector').omGrid('reload',3);//转到第3页
<span class='line'>1221</span>          * 
<span class='line'>1222</span>          */</span><span class="WHIT">
<span class='line'>1223</span> </span><span class="WHIT">        </span><span class="NAME">reload</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">page</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1224</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.loading</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1225</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1226</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1227</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">page</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1228</span> </span><span class="WHIT">                </span><span class="NAME">page</span><span class="PUNC">=</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">page</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1229</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">page</span><span class="PUNC">&lt;</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1230</span> </span><span class="WHIT">                    </span><span class="NAME">page</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1231</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1232</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">page</span><span class="PUNC">></span><span class="NAME">this.pageData.totalPages</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1233</span> </span><span class="WHIT">                    </span><span class="NAME">page</span><span class="PUNC">=</span><span class="NAME">this.pageData.totalPages</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1234</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1235</span> </span><span class="WHIT">                </span><span class="NAME">this.pageData.nowPage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">page</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1236</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1237</span> </span><span class="WHIT">            </span><span class="COMM">//相当于goto(page) and reload()，会转到那一页并重新刷新数据（向后台发送请求）</span><span class="WHIT">
<span class='line'>1238</span> </span><span class="WHIT">            </span><span class="COMM">//没有参数时刷新当前页</span><span class="WHIT">
<span class='line'>1239</span> </span><span class="WHIT">            </span><span class="NAME">this._populate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1240</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1241</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>1242</span>          * 选择行。&lt;b>注意：传入的参数是序号（第一行是0第二行是1）数组（比如[0,1]表示选择第一行和第二行）；要想清除所有选择，请使用空数组[]作为参数；只能传入序号数组，如果要做复杂的选择算法，请先在其它地方算好序号数组后后调用此方法；此方法会清除其它选择状态，如选择第1,2行然后setSelections([3])最后结果中只有第3行，如setSelections([3,4]);setSelections([5,6])后只会选择5,6两行&lt;/b>。
<span class='line'>1243</span>          * @name omGrid#setSelections
<span class='line'>1244</span>          * @function
<span class='line'>1245</span>          * @param indexes 序号（第一行是0第二行是1）数组。
<span class='line'>1246</span>          * @returns jQuery对象
<span class='line'>1247</span>          * @example
<span class='line'>1248</span>          * //选择表格中第二行、第三行、第五行
<span class='line'>1249</span>          * $('.selector').omGrid('setSelections',[1,2,4]);
<span class='line'>1250</span>          * 
<span class='line'>1251</span>          */</span><span class="WHIT">
<span class='line'>1252</span> </span><span class="WHIT">        </span><span class="NAME">setSelections</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">indexes</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1253</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1254</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">indexes</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1255</span> </span><span class="WHIT">                </span><span class="NAME">indexes</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="NAME">indexes</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1256</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1257</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selected</span><span class="PUNC">=</span><span class="NAME">this.getSelections</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1258</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">selected</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1259</span> </span><span class="WHIT">                </span><span class="NAME">self._rowDeSelect</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1260</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1261</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">indexes</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1262</span> </span><span class="WHIT">                </span><span class="NAME">self._rowSelect</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1263</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1264</span> </span><span class="WHIT">            </span><span class="NAME">self._refreshHeaderCheckBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1265</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1266</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>1267</span>          * 获取选择的行的行号或行记录。&lt;b>注意：默认返回的是行序号组成的数组（如选择了第2行和第5行则返回[1,4]），如果要返回行记录JSON组成的数组需要传入一个true作为参数&lt;/b>。
<span class='line'>1268</span>          * @name omGrid#getSelections
<span class='line'>1269</span>          * @function
<span class='line'>1270</span>          * @param needRecords 参数为true时返回的不是行序号数组而是行记录数组。参数为空或不是true时返回行序号数组。
<span class='line'>1271</span>          * @returns jQuery对象
<span class='line'>1272</span>          * @example
<span class='line'>1273</span>          * var selectedIndexed = $('.selector').omGrid('getSelections');
<span class='line'>1274</span>          * var selectedRecords = $('.selector').omGrid('getSelections',true);
<span class='line'>1275</span>          * 
<span class='line'>1276</span>          */</span><span class="WHIT">
<span class='line'>1277</span> </span><span class="WHIT">        </span><span class="NAME">getSelections</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">needRecords</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1278</span> </span><span class="WHIT">            </span><span class="COMM">//needRecords=true时返回Record[],不设或为false时返回index[]</span><span class="WHIT">
<span class='line'>1279</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1280</span> </span><span class="WHIT">            	</span><span class="NAME">$trs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1281</span> </span><span class="WHIT">            	</span><span class="NAME">selectedTrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$trs.filter</span><span class="PUNC">(</span><span class="STRN">'.om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1282</span> </span><span class="WHIT">            	</span><span class="NAME">result</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1283</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">needRecords</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1284</span> </span><span class="WHIT">            	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowsData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.getData</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">rows</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1285</span> </span><span class="WHIT">            	</span><span class="NAME">selectedTrs.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1286</span> </span><span class="WHIT">            		</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">result.length</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rowsData</span><span class="PUNC">[</span><span class="NAME">$trs.index</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1287</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1288</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1289</span> </span><span class="WHIT">            	</span><span class="NAME">selectedTrs.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1290</span> </span><span class="WHIT">            		</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">result.length</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$trs.index</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1291</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1292</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1293</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1294</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1295</span> </span><span class="WHIT">        </span><span class="NAME">destroy</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1296</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1297</span> </span><span class="WHIT">        	</span><span class="NAME">$el.closest</span><span class="PUNC">(</span><span class="STRN">'.om-grid'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">after</span><span class="PUNC">(</span><span class="NAME">$el</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1298</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1299</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1300</span> </span><span class="WHIT">    
<span class='line'>1301</span>     </span><span class="NAME">$.om.lang.omGrid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1302</span> </span><span class="WHIT">        </span><span class="NAME">loadingMsg</span><span class="PUNC">:</span><span class="STRN">'正在加载数据，请稍候...'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1303</span> </span><span class="WHIT">        </span><span class="NAME">emptyMsg</span><span class="PUNC">:</span><span class="STRN">'没有数据'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1304</span> </span><span class="WHIT">        </span><span class="NAME">errorMsg</span><span class="PUNC">:</span><span class="STRN">'取数出错'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1305</span> </span><span class="WHIT">        </span><span class="NAME">pageText</span><span class="PUNC">:</span><span class="STRN">'第{index}页，共{totalPage}页'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1306</span> </span><span class="WHIT">        </span><span class="NAME">pageStat</span><span class="PUNC">:</span><span class="STRN">'共{total}条数据，显示{from}-{to}条'</span><span class="WHIT">
<span class='line'>1307</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1308</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">jQuery</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>